<?php
    foreach ($getDetail as $row) {
        $vid 			= $row['ID'];
    	$vname 			= $row['NAME'];
    	$vorg 			= $row['ORG'];
    	$vposition 		= $row['JOB_POSITION'];
    	$vcouriertype 	= $row['DMR_COURIER_TYPE'];
    	$vtujuan 		= $row['DMR_TUJUAN'];
    	$vpenjemputan 	= $row['DMR_PENJEMPUTAN'];
    	$vfloor 		= $row['DMR_FLOOR'];
    	$vtype 			= $row['DMR_TYPE'];
    	$vcategory 		= $row['DMR_CATEGORY'];
    	$vwaktupenjemputan = $row['DMR_WAKTU_PENJEMPUTAN'];
    	$vdesc 			= $row['DMR_DESCRIPTION'];
    	$vAtasanNik 	= $row['DMR_ATASAN_APP_ID'];
    	//$vAtasanName = dbora_getname("$vAtasanNik");
        $vAtasanName = $vname;	
    	$vRecieveDate = $row['DMR_RECIEVE_DATE'];
    }
    
    
?>

<script>
    function cancel() {
        $.post("<?= site_url() ?>search_global", function(data) {
            window.location = '<?php echo base_url(); ?>search_global';
        });
    }
    function appGaPublicRoomSave() {
        $.post("<?= site_url() ?>search_global/approve_gaPublicRoomSave", {
            pDmrID: $('#pDmrID').val(),
            pApproval: $('#pApproval').val(),
            pComment: $('#pComment').val(),
            pDmKurir: $('#pDmKurir').val(),
            pDmBerat: $('#pDmBerat').val(),
            pNikRequestBy: $('#pNikRequestBy').val()
        },
        function(data) {
            window.location = '<?php echo base_url(); ?>search_global';
        }
        );
    }
</script>


<form id="formarea" role="form" method="post" action="#">
    <input type="hidden" value="<?php echo $cRequestNo; ?>" id="pCtrlID" />
    <input type="hidden" value="<?php echo $cTab; ?>" id="pCTab" />
    <input type="hidden" value="<?php echo $cType; ?>" id="pCType" />
    <input type="hidden" value="<?php echo $vid;?>" id="pNikRequestBy" name="pNikRequestBy"/>
<div class="col-md-offset-0" id="top">
    <div class="col-md-11">
        <div class="panel panel-default">
			<div class="panel-heading">
			<h4 class="panel-title"><b> Requestor </b></h4>
			</div>
			<div class="panel-body">
            <input type="hidden" value="<?php echo $cRequestNo; ?>" id="pDmrID" />
                
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Jasa Kurir</label>
    						<div class="col-md-9">
                            <?
                    			echo $vcouriertype;
                    		?>
                            </div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Area Tujuan</label>
    						<div class="col-md-9"><?php echo $vtujuan; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Regional Tujuan</label>
    						<div class="col-md-9"><?php echo $vpenjemputan; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Lantai</label>
    						<div class="col-md-9"><?php echo $vfloor ; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Jenis</label>
    						<div class="col-md-9"><?php echo $vtype; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Kategori</label>
    						<div class="col-md-9"><?php echo $vcategory; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Waktu Penjemputan</label>
    						<div class="col-md-9"><?php echo $vwaktupenjemputan." : 00"; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Nama Atasan</label>
    						<div class="col-md-9"><?php echo $vAtasanName; ?></div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Description</label>
    						<div class="col-md-4">
                                <textarea class="form-control input-sm" name="pDmDesc"><?php echo $vdesc; ?></textarea>
    						</div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Kurir</label>
    						<div class="col-md-4">
                                <select class="form-control input-form select2" id="pDmKurir" style="width:100%">
                                <?php
                                foreach($getKurir as $a){
                                ?>
                        			<option value="<?php echo $a['COURIER_ID']; ?>"><?php echo $a['COURIER_NAME'];?></option>
                                <?php
                                }
                                ?>
                                </select>
    						</div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Berat</label>
    						<div class="col-md-4">
                                <input class="form-control input-form" id="pDmBerat" style="width:100%" value="0"/>
    						</div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Comment</label>
    						<div class="col-md-4">
                                <textarea class="form-control input-sm" id="pComment"></textarea>
    						</div>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3">Approval</label>
    						<div class="col-md-4">
                                <select class="form-control input-form select2" id="pApproval" style="width:100%">
                        			<option value="Y">Approve</option>
                                    <option value="N" selected="">Disapprove</option>
				                </select>
    						</div>
				        </div>
                    </div>                   
                </div>
                
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3"></label>
				        </div>
                    </div>                   
                </div>
                <div class="row"> 
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="control-label col-md-3"></label>
    						<div class="col-sm-2">
                                <button type="button" class="btn btn-primary btn-block" onclick="appGaPublicRoomSave();">Submit</button>
                            </div>
                            <div class="col-sm-2">
                                <button type="button" class="btn btn-default btn-block" onclick="cancel();" >Cancel</button>
                            </div>
				        </div>
                    </div>                   
                </div>
                
            </div>
        </div>
    
    </div>
</div>
</form>